Logo
Spacer News Wiki Features F.A.Q. Team members Screenshots Download Messageboard Bug tracker Submit files
Top divider

Lua UnsyncedRead

Contents

[edit] Replay/Spectating

Spring.IsReplay

 ( ) -> nil | boolean

Spring.GetSpectatingState

 ( ) -> boolean spectating, boolean fullView, boolean fullSelect

[edit] Unit

Spring.IsUnitAllied

 ( number unitID ) -> nil | boolean

Spring.GetUnitViewPosition

 ( number unitID [, boolean extrapolated ] ) -> nil | boolean

[edit] Team/Player Info

Spring.GetPlayerRoster

 ( [number sortType] ) ->
   nil | playerTable = {
           [1] = {
             string  name,
             number  playerID,
             number  teamID,
             number  allyTeamID,
             boolean spectator,
             numebr  cpuUsage,
             number  pingTime
           },
           etc...
         }
   Sort codes:
    1 = Sort by allies  (the default)
    2 = Sort by teamID
    3 = Sort by playerName
    4 = Sort by CPU usage
    5 = Sort by ping time

Spring.GetTeamColor

 ( number teamID ) -> nil | number r, number g, number b,  number a

Spring.GetTeamOrigColor

 ( number teamID ) -> nil | number r, number g, number b,  number a

[edit] Local Player,Team,Ally

Spring.GetLocalPlayerID

 ( ) -> number playerID

Spring.GetLocalTeamID

 ( ) -> number teamID

Spring.GetLocalAllyTeamID

 ( ) -> number allyID

[edit] Selected Units

Spring.GetSelectedUnits

 ( ) -> { [1] = unitID, ... }

Spring.GetSelectedUnitsSorted

 ( ) -> { [number unitDefID] = { [1] = [number unitID], etc...}, ... }

Spring.GetSelectedUnitsCounts

 ( ) -> { [number unitDefID] = number count, etc... }

Spring.GetSelectedUnitsCount

 ( ) -> number count

Spring.IsUnitSelected

 ( number unitID ) -> nil | boolean

[edit] GUI Settings

Spring.IsGUIHidden

 ( ) -> nil | boolean

Spring.HaveShadows

 ( ) -> nil | boolean

Spring.HaveAdvShading

 ( ) -> nil | boolean

Spring.GetWaterMode

 ( ) -> nil | number mode, string "mode"
   mode numbers:
     0 - basic
     1 - reflective
     2 - dynamic
     3 - refractive
     default - unknown

Spring.GetMapDrawMode

 ( ) -> nil | "normal" | "height" | "metal" | "path" | "los"

[edit] Camera

Spring.GetCameraNames

 ( ) -> { [camName] = number camNum, ... }

Spring.GetCameraState

 ( ) -> { "mode" = number, "name" = string, [1] = number, [2] = number, ... }

Spring.GetCameraPosition

 ( ) -> number x, number y, number z

Spring.GetCameraDirection

 ( ) -> number forward_x, number forward_y, number forward_z

Spring.GetCameraFOV

 ( ) -> number fov

Spring.GetCameraVectors

 ( ) -> vectorTable = {
   forward   = { [1] = number x, [2] = number y, [3] = number z },
   up        = { [1] = number x, [2] = number y, [3] = number z },
   right     = { [1] = number x, [2] = number y, [3] = number z },
   top       = { [1] = number x, [2] = number y, [3] = number z },
   bottom    = { [1] = number x, [2] = number y, [3] = number z },
   leftside  = { [1] = number x, [2] = number y, [3] = number z },
   rightside = { [1] = number x, [2] = number y, [3] = number z }
 }

[edit] Inview

Spring.GetVisibleUnits

 ( [number teamID = -1 [, number radius = 30 [, boolean Icons ]]] )
   -> nil | unitTable = { [1] = number unitID, ... }

Spring.IsAABBInView

 ( number minX, number minY, number minZ,
   number maxX, number maxY, number maxZ ) -> nil | boolean

Spring.IsSphereInView

 ( number x, number y, number z [, number radius ] ) -> nil | boolean

Spring.IsUnitInView

 ( number unitID ) -> nil | boolean

Spring.IsUnitVisible

 ( number unitID [, number radius ] ) -> nil | boolean

[edit] Screen Trace

Spring.WorldToScreenCoords

 ( number x, number y, number z ) -> number x, number y, number z

Spring.TraceScreenRay

 ( number mouseX, number mouseY[, boolean onlyCoords] )
   -> nil |
   string "unit",    number unitID    |
   string "feature", number featureID |
   string "ground",  { [1] = number x, [2] = number y, [3] = number z }

[edit] Time

Spring.GetFrameTimeOffset

 ( ) -> nil | number

Spring.GetLastUpdateSeconds

 ( ) -> nil | number

Spring.GetHasLag

 ( ) -> boolean

Spring.GetTimer

 ( ) -> timer

Spring.DiffTimers

 ( timer1, timer2 ) -> number seconds

Retrieved from "http://spring.clan-sy.com/wiki/Lua_UnsyncedRead"

This page has been accessed 546 times. This page was last modified 18:45, 18 January 2008.